package com.rbs.service.impl;

import com.rbs.entity.Address;
import com.rbs.mapper.AddressMapper;
import com.rbs.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;
    @Override
    public List<Address> selectByUserId(int userId) {
        return addressMapper.selectByUserId(userId);
    }

    @Override
    public void deleteById(int addressId) {
        addressMapper.deleteById(addressId);
    }

    @Override
    public void updateSelectedStateToNull(int userId) {
        addressMapper.updateSelectedStateToNull(userId);
    }

    @Override
    public void updateSelectedStateToSelectedState(int addressId) {
        addressMapper.updateSelectedStateToSelectedState(addressId);
    }
}
